﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AsmShaderConverter.HlslShader
{
    public enum HlslTypes
    {
        halfFloat,
        float1,
        float2,
        float3,
        float4,
        float3x2,
        float3x3,
        float4x2,
        float4x3,
        float4x4,
        Matrix3x2,
        Matrix3x3,
        Matrix4x2,
        Matrix4x3,
        Matrix4x4
    }

    public class HlslShaderType
    {
        public static HlslTypes GetHlslType(string text)
        {
            if (text == "float")
                text = "float1";

            try
            {
                HlslTypes type = (HlslTypes)Enum.Parse(typeof(HlslTypes), text);
                return type;
            }
            catch (Exception)
            {
                throw new Exception("Can´t convert hlsltype: " + text);
            }
        }
    }
}
